Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extensibility point for passing additional args to packager #12863

Closed
wants to merge 2 commits into from

Conversation

ligaz
Copy link

@ligaz ligaz commented Mar 10, 2017

Extend react-native-xcode.sh to allow passing of additional args to
bundle command. This is useful if you want to generate source maps for
example.

Here is an example that modifies the “Bundle React Native code and
images” script phase:

export NODE_BINARY=node
export EXTRA_PACKAGER_ARGS="--sourcemap-output ${SRCROOT}/build/main.jsbundle.map"

./react-native-xcode.sh

Android’s build.gradle already have this extensibility point in the name
of:

project.ext.react = [
    extraPackagerArgs: [
    ]
]

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Mar 10, 2017
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Extend `react-native-xcode.sh` to allow passing of additional args to
bundle command. This is useful if you want to generate source maps for
example.

Here is an example that modifies the “Bundle React Native code and
images” script phase:

```sh
export NODE_BINARY=node
export EXTRA_PACKAGER_ARGS="--sourcemap-output ${SRCROOT}/build/main.jsbundle.map"

./react-native-xcode.sh

```

Android’s `build.gradle` already have this extensibility point in the name
of:
```gradle
project.ext.react = [
    extraPackagerArgs: [
    ]
]
```
@ligaz
Copy link
Author

ligaz commented Mar 29, 2017

Ping @dlowder-salesforce. Can you please take a look? Thanks.

@douglowder
Copy link
Contributor

Looks ok to me.... ping @hramos @javache

@chirag04
Copy link
Contributor

@ligaz are there more extension points other than sourcemap-output? if not what do you think about simply adding sourcemap-output?

SOURCEMAP_FILE="$BUNDLE_FILE.map"
--sourcemap-output "$SOURCEMAP_FILE"

@ligaz
Copy link
Author

ligaz commented Mar 29, 2017

@chirag04 Here is the full list of all bundle args. Having it generic (like it is implemented for Android) is more future proof in case new command line args are added.

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Mar 29, 2017
@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Mar 30, 2017
@facebook-github-bot
Copy link
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Mar 30, 2017
@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hramos
Copy link
Contributor

hramos commented Mar 30, 2017

This should be landing shortly. We had some minor issues landing this internally but I've resolved them manually.

@ligaz
Copy link
Author

ligaz commented Apr 21, 2017

Hey @hramos what's the state of this PR?

@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hramos
Copy link
Contributor

hramos commented Apr 25, 2017

The original import failed due to some changes we made to our internal repository. This last one should import successfully.

@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@Froelund
Copy link

Froelund commented May 4, 2017

Any news about this @hramos ? I'm uncertain about the process, is there anything I can do to help?

@Froelund
Copy link

image

@skevy
Copy link
Contributor

skevy commented Jun 8, 2017

Hi there!

The packager no longer lives in this repo. It now lives in https://github.com/facebook/metro-bundler. The reasoning for the split is explained here: #13976.

If you're still interested in pursuing this PR, please open the PR on that repo! :)

Thanks!
-Adam

@skevy skevy closed this Jun 8, 2017
@skevy
Copy link
Contributor

skevy commented Jun 8, 2017

@Froelund sorry this didn't get merged! It should be much easier to contribute to the packager now that it's separate.

@brunolemos
Copy link
Contributor

Did anyone create this issue on the new repo? Couldn't find it.

cc @ligaz

@ligaz
Copy link
Author

ligaz commented Nov 22, 2017

I believe this script still lives in this repo and not the packager one. @hramos how are we supposed to progress with this one?

brunolemos added a commit to brunolemos/react-native that referenced this pull request Nov 22, 2017
brunolemos added a commit to brunolemos/react-native that referenced this pull request Dec 11, 2017
facebook-github-bot pushed a commit that referenced this pull request Jan 22, 2018
Summary:
Original pull request: #12863

Useful for generating source maps, for example.

Feature parity with Android, that already have this extensibility point on `build.gradle`:
```
project.ext.react = [
    extraPackagerArgs: [...]
]
```

Xcode > Build Phases > Bundle React Native code and Images
```
export NODE_BINARY=node
export EXTRA_PACKAGER_ARGS="--sourcemap-output ${SRCROOT}/build/main.jsbundle.map"
../node_modules/react-native/scripts/react-native-xcode.sh
```

[IOS] [FEATURE] [./react-native-xcode.sh] - Added $EXTRA_PACKAGER_ARGS extensibility point
Closes #16933

Differential Revision: D6771709

Pulled By: yungsters

fbshipit-source-id: a33614b45b1e3537daeb31504fdd3a402dc70ff0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants